package com.chb.decorator;

/**
 * @author chihb
 * @create-time 2024/10/24 14:25
 * @description
 */
public class Test {
    public static void main(String[] args) {
        ABatterCake batterCake = new BatterCake();
        System.out.println(batterCake.getDesc()+" 销售价格："+batterCake.cost());
        Decorator decorator = new Egg(batterCake);
        System.out.println(decorator.getDesc()+" 销售价格："+decorator.cost());
        decorator=new Vegetable(decorator);
        System.out.println(decorator.getDesc()+" 销售价格："+decorator.cost());
        decorator=new Egg(decorator);
        System.out.println(decorator.getDesc()+" 销售价格："+decorator.cost());
    }
}
